using Godot;
using System;

public partial class SelfFreeParticle : GpuParticles2D
{
	[Signal]
	public delegate void PlayFinishedEventHandler(int particle, int type);
	
	[Export]
	public int ParticleType { get; set; } = -1;

	public int ParticleID = -1;

    public override void _Ready()
    {
		Finished += Signal_PlayFinished;
    }

	private void Signal_PlayFinished()
	{
		EmitSignal(SignalName.PlayFinished, ParticleID, ParticleType);
		GetParent().RemoveChild(this);
		QueueFree();
	}
}
